//---------------------------------------------------------------------
// Copyright (C) 2010 - Cobalt Solution / Sebastien Leon              |
//---------------------------------------------------------------------
// This software is under dual licence: commercial licence + GPL v3   |
// To keep closed your modification of this software, you need to     |
// contact me to obtain a commercial licence.                         |
// Any other derivated work should remain Open Source.                |
// Contact me for a licence, a question or if you want to commit      |
// your code to the main tree: seb at cobaltsolutions dot info        |
//---------------------------------------------------------------------

#ifndef _MAINFORM_H_
#define _MAINFORM_H_

#include "ui_mainForm.h"
#include <QFileSystemModel>
#include <QSystemTrayIcon>

class Core;
class QGraphicsScene;

class MainForm : public QMainWindow
{
  Q_OBJECT
public:
  MainForm(QWidget* parent, Core& loomfeed);
  ~MainForm() {};

  QGraphicsScene& LoomScene();
  bool IsReadOnly  () { return ui.mp_lockUI->isChecked(); }
  void ValidLoomPosSizeChange(Loom*);
  void DblClickItem(QGraphicsItem* item);
  void InitiateTransfer(QFileInfo& nfo, const Loom* p_loom);
private:
  Ui::mainForm     ui;
  Core&            mr_loomfeed;
  QFileSystemModel m_dirModel;
  QSystemTrayIcon  m_sysTray;
protected slots:
  void MessageFromCore(const QString&, QSystemTrayIcon::MessageIcon icon);
  void PathModified();
  void OnSelectionChanged();
  void OnEditPref();
  void OnLockUI  ();
  void OnPrint   ();
  void OnHelp    ();
  void OnAddLoom ();
};

#endif // _MAINFORM_H_